package com.forum.mapper;

import com.forum.model.entity.Announcement;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface AnnouncementMapper {
    
    @Select("SELECT * FROM announcement WHERE status = 1 AND " +
            "start_time <= NOW() AND (end_time IS NULL OR end_time >= NOW()) " +
            "ORDER BY type DESC, created_at DESC LIMIT 5")
    List<Announcement> findActiveAnnouncements();
} 